{include file="public/header"}
<style>
    #des{
        position: relative;
        z-index: 0;
    }
</style>
<form class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin" style="padding: 20px 20px 20px 0;">
    <input type="hidden" name="id" value="{$info._id}" >
    <div class="layui-form-item">
        <label class="layui-form-label">标签名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" value="{$info.name}" placeholder="请输入标签名称" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">解压码</label>
        <div class="layui-input-block">
            <input type="text" name="password" placeholder="请输入解压码" value="{$info.password}" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">ZIP文件</label>
        <div class="layui-input-block">
            <button type="button" class="layui-btn" id="zip">
                <i class="layui-icon"></i>上传文件
            </button>
            <span id="zip_tips">{if $info.annex_zip != ''}已上传{/if}</span>
        </div>
    </div>
    <input type="hidden" name="annex_zip" id="annex_zip" value="{$info.annex_zip}">

    <div class="layui-form-item">
        <label class="layui-form-label">所属</label>
        <div class="layui-input-block">
            <select name="month">
                <option value="三大设定" {if $info.month == "三大设定"}selected{/if}>三大设定</option>
                <option value="攻受属性" {if $info.month == "攻受属性"}selected{/if}>攻受属性</option>
                <option value="攻受关系" {if $info.month == "攻受关系"}selected{/if}>攻受关系</option>
                <option value="剧情内容" {if $info.month == "剧情内容"}selected{/if}>剧情内容</option>
                <option value="身份角色" {if $info.month == "身份角色"}selected{/if}>身份角色</option>
                <option value="文章风格" {if $info.month == "文章风格"}selected{/if}>文章风格</option>
                <option value="题材背景" {if $info.month == "题材背景"}selected{/if}>题材背景</option>
<!--                <option value="其他" {if $info.month == "其他"}selected{/if}>其他</option>-->
            </select>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">排序</label>
        <div class="layui-input-block">
            <input type="text" name="sort" value="{$info.sort}" placeholder="请输入排序" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-front-submit" value="确认">
    </div>
</form>

<script src="__ADMIN__/layuiadmin/layui/layui.js"></script>
<script type="text/javascript">
    window.HOST_TYPE='2'
</script>
<script>
    layui.config({
        base: '__ADMIN__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['form', 'upload', 'layedit'], function(){
        var $ = layui.$
            ,layedit = layui.layedit
            ,form = layui.form
            ,upload = layui.upload;

        //执行实例
        var uploadInst2 = upload.render({
            elem: '#zip'                //绑定元素
            , method: "get"
            , url: "{:url($module . '/upload_annex')}"      //上传接口

            //*********************传输限制
            // , size: 100                   //传输大小100k
            , exts: 'txt|zip'//'jpg|png|gif|'        //可传输文件的后缀
            , accept: 'file'              //video audio images

            //****************传输操作相关设置
            , data: { type: "1" }    //额外传输的参数
            // , headers: {token:'sasasasa'}                   //额外添加的请求头
            // , auto: false                                 //自动上传,默认是打开的
            // , bindAction: '#btnUpload'                    //auto为false时，点击触发上传
            // , multiple: false                             //多文件上传
            //, number: 100                               //multiple:true时有效

            , done: function (res) {                      //传输完成的回调
                console.log(res);
                $('#annex_zip').val(res.data);
                $('#zip_tips').text("已上传");
            }
            , error: function () {                         //传输失败的回调
                //请求异常回调
                // console.log(1);
            }
        });
    })
</script>
{include file="public/footer"}
